package com.gohome.gohomechat.model.entify;

import android.os.Parcel;
import android.os.Parcelable;

import com.easemob.chat.EMMessage;

/**
 * Created by dllo on 16/3/12.
 */
public class ChatType implements Parcelable{
    private EMMessage.ChatType chatType;
    private String chatname;

    public ChatType(EMMessage.ChatType chatType, String chatname) {
        this.chatType = chatType;
        this.chatname = chatname;
    }

    protected ChatType(Parcel in) {
        chatname = in.readString();
    }

    public static final Creator<ChatType> CREATOR = new Creator<ChatType>() {
        @Override
        public ChatType createFromParcel(Parcel in) {
            return new ChatType(in);
        }

        @Override
        public ChatType[] newArray(int size) {
            return new ChatType[size];
        }
    };

    public EMMessage.ChatType getChatType() {
        return chatType;
    }

    public void setChatType(EMMessage.ChatType chatType) {
        this.chatType = chatType;
    }

    public String getChatname() {
        return chatname;
    }

    public void setChatname(String chatname) {
        this.chatname = chatname;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(chatname);
    }
}
